package com.example.lib_repair

import com.example.lib_common.mvi.ResponseEntity
import com.example.lib_repair.detail.AddEntity
import com.example.lib_repair.detail.DetailEntity
import com.example.lib_repair.detail.ImgEntity
import com.example.lib_repair.detail.UserEntity
import kotlinx.coroutines.flow.Flow
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import java.util.*

interface ApiService {

    @POST("sysRepair/selAllRepair")
    fun requestAllRepair() : Flow<ResponseEntity<List<RepairEntity>>>

    @POST("sysRepair/selRepairValues")
    fun requestDetailRepair(@Body body: RequestBody) : Flow<ResponseEntity<DetailEntity>>

    @POST("sysRepair/addRepair")
    fun requestAddRepair(@Body body: RequestBody) : Flow<ResponseEntity<AddEntity>>

    @POST("sysRepair/selSysRepairUser")
    fun requestRepairUser() : Flow<ResponseEntity<List<UserEntity>>>

    @POST("sysRepair/completedRepair")
    fun requestCompleteRepair(@Body body: RequestBody) : Flow<ResponseEntity<AddEntity>>

    @Multipart
    @POST("fileUpload")
    fun uploadIms(@Part list: List<MultipartBody.Part>):Flow<ResponseEntity<ImgEntity>>

    @POST("sysRepair/addRepairImg")
    fun requestAddRepairImg(@Body body: RequestBody) : Flow<ResponseEntity<ImgEntity>>
}